{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    " \n",
    "import os \n",
    "import sys\n",
    "\n",
    "import time\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from PIL import Image\n",
    "import cv2\n",
    "\n",
    "\n",
    "root_path = '/root/mall_stat/data'\n",
    "\n",
    "os.chdir(root_path)\n",
    "from IPython import  embed \n",
    "\n",
    "from os.path import join,split,exists\n",
    "\n",
    "\n",
    "from os.path import  join,split,exists\n",
    "\n",
    "from tqdm import tqdm \n",
    "import shutil\n",
    "import json \n",
    "\n",
    "\n",
    "def load_json(file_name):\n",
    "\n",
    "    assert exists(file_name)\n",
    "    with open(file_name)as f:\n",
    "        body_qualities = json.load(f)\n",
    "\n",
    "    return body_qualities\n",
    "\n",
    "\n",
    "def make_dir(tgt_dir):\n",
    "    if not exists(tgt_dir):\n",
    "        os.makedirs(tgt_dir)\n",
    "    \n",
    "\n",
    "def show_img(img_path):\n",
    "\n",
    "    plt.imshow(cv2.imread(img_path)[:,:,::-1])\n",
    "    plt.xticks([])\n",
    "\n",
    "    plt.yticks([])\n",
    "    plt.title('Query')\n",
    "    plt.show()\n",
    "    \n",
    "def show_imgs(similar_list,titles=None):\n",
    "    figure_size = 1 #* row number \n",
    "    length = len(similar_list)\n",
    "    figure_size = figure_size*10 + length\n",
    "    plt.figure(dpi = 300)\n",
    "\n",
    "    for idx in range(length):\n",
    "        # pos = str(figure_size*10 + idx +1)\n",
    "        pos = figure_size*10 + idx +1\n",
    "        plt.subplot(pos,title=str(idx + 1) if titles is None else titles[idx])\n",
    "        \n",
    "        plt.imshow(cv2.imread(similar_list[idx])[:,:,::-1])\n",
    "        plt.xticks([])\n",
    "        plt.yticks([])\n",
    "    plt.show()\n",
    "\n",
    "\n",
    "\n",
    "    \n",
    "def show_imgs2(similar_list,titles=None):\n",
    "    figure_size = 1 #* row number \n",
    "    length = len(similar_list)\n",
    "    figure_size = figure_size*10 + length\n",
    "    plt.figure(dpi = 300)\n",
    "\n",
    "    for idx in range(length):\n",
    "        # pos = str(figure_size*10 + idx +1)\n",
    "        pos = figure_size*10 + idx +1\n",
    "        plt.subplot(pos,title=str(idx + 1) if titles is None else titles[idx])\n",
    "        \n",
    "        plt.imshow(similar_list[idx][:,:,::-1])\n",
    "        plt.xticks([])\n",
    "        plt.yticks([])\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 8/8 [00:00<00:00, 37.58it/s]\n"
     ]
    }
   ],
   "source": [
    "data_root = '/root/mall_stat/data/mall_staff_full/annotated'\n",
    "\n",
    "tgt_dir = data_root.replace('annotated','backup/images')\n",
    "\n",
    "\n",
    "dates = [x for x in os.listdir(data_root) if x.startswith('2024')]\n",
    "\n",
    "\n",
    "# for d in tqdm(dates):\n",
    "#     shutil.copy(join(data_root,d,'sim_pid_pairs.csv'), join(tgt_dir,d))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "1\n",
      "1\n",
      "1\n",
      "1\n",
      "1\n",
      "1\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "from glob import glob\n",
    "image_tag= [x for x in os.listdir(data_root) if x.startswith('ImageTag')]\n",
    "\n",
    "dates = [ x.split('_')[-2] for x in image_tag]\n",
    "\n",
    "for d,name in zip(dates,image_tag):\n",
    "\n",
    "    jsons = glob(join(data_root,name,'*.json'))\n",
    "    print(len(jsons))\n",
    "\n",
    "    shutil.copy(jsons[0], join(tgt_dir,d))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Count data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['20240604', '20240612', '20240615', '20240522', '20240508', '20240525', '20240503', '20240530'] 8\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n",
      "json file number is  1\n"
     ]
    }
   ],
   "source": [
    "\n",
    "from glob import glob\n",
    "data_root = '/root/mall_stat/data/mall_staff_full/annotated'\n",
    "\n",
    "label_dir_names= [x for x in os.listdir(data_root) if x.startswith('ImageTag')]\n",
    "\n",
    "dates = [ x.split('_')[-2] for x in label_dir_names]\n",
    "\n",
    "# print(label_dir_name,)\n",
    "print(dates,len(dates))\n",
    "\n",
    "\n",
    "labels = {}\n",
    "for l,d in zip(label_dir_names,dates):\n",
    "\n",
    "    jsons = glob(join(data_root,l,'*.json'))\n",
    "\n",
    "    print(\"json file number is \",  len(jsons))\n",
    "\n",
    "    json_file_name = join(data_root,l,jsons[0])\n",
    "\n",
    "    with open(json_file_name,) as f:\n",
    "        label = json.load(f)\n",
    "\n",
    "\n",
    "    extracted_label = {}\n",
    "    for k,v in label.items():\n",
    "        if v is not None and v.get('label_result', None ) is not None and v['label_result'].get('isCorrect',None) is not None :\n",
    "            extracted_label[k] = v['label_result']['isCorrect']\n",
    "    labels[d] = extracted_label\n",
    "\n",
    "    \n",
    "    \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "label_days  = {}\n",
    "for d in dates:\n",
    "    label_days.update(labels[d])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Counter({2: 19642, 0: 477, 1: 13})\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'label statistics')"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAj8AAAHHCAYAAABQhTneAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAxbElEQVR4nO3deVTV5b7H8c9GBRwY9KIgV5TStHCAxCEtFZUi85o2nDpmpTZZoeKi4ejtnGw4pTaoDbvseFfSMTtig9bJUx5TccpMRSxFSw2nFMwJFA0UnvtH130j1NiwNxt83q+19srf83v28/v+nrXX5tNv2g5jjBEAAIAl/HxdAAAAQHUi/AAAAKsQfgAAgFUIPwAAwCqEHwAAYBXCDwAAsArhBwAAWIXwAwAArEL4AQAAViH8ABZKS0uTw+HQrl273H5vQkKCOnTo4NF6oqOjNWLECI+O6Wm7du2Sw+FQWlqaR8bLyMiQw+FQRkaGR8YDUHGEHwAXjezsbD311FOVCnVnvffee5o+fbrHanrjjTc8FpgAeEZdXxcAAJ6SnZ2tp59+WgkJCYqOjq7UGO+99542b96scePGlWlv1aqVTp06pXr16rk13htvvKGwsLByR7Z69+6tU6dOyd/fv1J1Aqg8wg8AVIDD4VBgYKDHxvPz8/PoeAAqjtNeACRJH3/8sQYOHKjIyEgFBASodevWevbZZ1VSUnLO/hs2bFDPnj1Vv359XXLJJZoxY0a5PkVFRZo4caLatGmjgIAARUVF6fHHH1dRUVGlapw7d67i4+MVFBSk4OBgdezYUa+88oqkX65j+sMf/iBJ6tu3rxwOR5lraiqyfwkJCVq4cKF2797tev/ZI0jnuuYnNzdXI0eOVIsWLRQQEKDmzZtr8ODBrtNu0dHR2rJli5YvX+4aLyEhQdL5r/lZu3atbrjhBjVu3FgNGzZUp06dXPtYkW0C+H0c+QEg6Zfw0KhRI6WmpqpRo0ZaunS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EHAABYhfADAACsYm344QnPAADYydrwwxOeAQCwk7XhBwAA2InwAwAArEL4AQAAViH8AAAAqxB+AACAVQg/AADAKoQfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABWIfwAAACrWBt++FV3AADsZG344VfdAQCwk7XhBwAA2InwAwAArEL4AQAAViH8AAAAqxB+AACAVQg/AADAKoQfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABWIfwAAACrEH4AAIBVCD8AAMAqhB8AAGAVwg8AALCKteHH6XQqJiZGXbt29XUpAACgGlkbfpKTk5Wdna1169b5uhQAAFCNrA0/AADAToQfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABWIfwAAACrEH4AAIBVCD8AAMAqhB8AAGAVwg8AALAK4QcAAFiF8AMAAKxC+AEAAFYh/AAAAKsQfgAAgFUIPwAAwCqEHwAAYJW6vi4AgPdEj1/o6xLgY7smD/R1CUCNw5EfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABWuSjCz0033aTGjRvr1ltv9XUpAACghrsowk9KSor+/ve/+7oMAABQC1wU4SchIUFBQUG+LgMAANQCPg8/K1as0KBBgxQZGSmHw6EFCxaU6+N0OhUdHa3AwEB1795dX3/9dfUXCgAALgo+Dz+FhYWKjY2V0+k85/r09HSlpqZq4sSJyszMVGxsrJKSknTw4MFqrhQAAFwMfP7zFgMGDNCAAQPOu37q1Km6//77NXLkSEnSjBkztHDhQr399tsaP36829srKipSUVGRa7mgoMD9ogEAQK3l8yM/F1JcXKwNGzYoMTHR1ebn56fExEStWbOmUmNOmjRJISEhrldUVJSnygUAALVAjQ4/hw4dUklJicLDw8u0h4eHKzc317WcmJioP/zhD/rXv/6lFi1aXDAYTZgwQfn5+a7X3r17vVY/AACoeXx+2ssTvvjiiwr3DQgIUEBAgBerAQAANVmNPvITFhamOnXqKC8vr0x7Xl6eIiIifFQVAACozWr0kR9/f3/Fx8dryZIlGjJkiCSptLRUS5Ys0ejRoz2yDWOMJO9c+FxadNLjY6J28fUF9XwGwWcQvuatz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WvXmlWrVpnLLrvMDB061LV+3759pl27dmbt2rXGGGN27NhhnnnmGbN+/XqTk5NjPv74Y3PppZea3r17+2oXqtXcuXNNQECASUtLM9nZ2eaBBx4woaGhJjc31xhjzF133WXGjx/v6r969WpTt25d89JLL5mtW7eaiRMnmnr16plvv/3WV7vgU+7O39NPP20WLVpkdu7caTZs2GD++Mc/msDAQLNlyxZf7YJPHT9+3GzcuNFs3LjRSDJTp041GzduNLt37zbGGDN+/Hhz1113ufr/8MMPpkGDBuaxxx4zW7duNU6n09SpU8d8/vnnvtoFn3N3DqdNm2YWLFhgtm/fbr799luTkpJi/Pz8zBdffOGrXfCphx56yISEhJiMjAxz4MAB1+vkyZOuPnwPnl9l5s9T34OEn185fPiwGTp0qGnUqJEJDg42I0eONMePH3etz8nJMZLMsmXLjDHG7Nmzx/Tu3ds0adLEBAQEmDZt2pjHHnvM5Ofn+2gPqt9rr71mWrZsafz9/U23bt3MV1995VrXp08fM3z48DL9582bZ9q2bWv8/f1N+/btzcKFC6u54prFnfkbN26cq294eLi54YYbTGZmpg+qrhnO3nb929fZORs+fLjp06dPuffExcUZf39/c+mll5pZs2ZVe901ibtzOGXKFNO6dWsTGBhomjRpYhISEszSpUt9U3wNcK65k1Tmc8X34PlVZv489T3o+L8CAAAArHDRX/MDAADwa4QfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABWIfwAAACrEH4AeExCQoLGjRtX4f4ZGRlyOBw6duxYlbYbHR2t6dOnV2mM3+PuvgGouQg/AADAKoQfAABgFcIPAK+ZPXu2unTpoqCgIEVEROiOO+7QwYMHy/VbvXq1OnXqpMDAQF111VXavHlzmfWrVq1Sr169VL9+fUVFRWns2LEqLCysUA3//ve/FRgYWO7UWkpKivr16ydJOnz4sIYOHar//M//VIMGDdSxY0f94x//uOC4DodDCxYsKNMWGhqqtLQ01/LevXt12223KTQ0VE2aNNHgwYO1a9euCtUNwHsIPwC85vTp03r22We1adMmLViwQLt27dKIESPK9Xvsscf08ssva926dWratKkG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xyvX79+ev3117Vx40atX79eDz74oOrVq1dme2FhYRo8eLBWrlypnJwcZWRkaOzYsdq3b59btQPwLMIPAK9o2rSp0tLS9P777ysmJkaTJ0/WSy+9dM6+kydPVkpKiuLj45Wbm6t//vOf8vf3lyR16tRJy5cv1/fff69evXrpyiuv1JNPPqnIyEi36mnTpo26deumb775xnWX11l//vOf1blzZyUlJSkhIUERERGu8HU+L7/8sqKiotSrVy/dcccdevTRR8tcI9SgQQOtWLFCLVu21M0336wrrrhC9957r37++WeOBAE+5jC/PWkNAABwEePIDwAAsArhBwAAWIXwAwAArEL4AQAAViH8AAAAqxB+AACAVQg/AADAKoQfAABgFcIPAACwCuEHAABYhfADAACsQvgBAABW+V9Z0cZ5vn6j8wAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "from collections import  Counter\n",
    "\n",
    "\n",
    "x = []\n",
    "y = []\n",
    "\n",
    "counter_res = Counter(label_days.values())\n",
    "print(counter_res)\n",
    "\n",
    "for k ,v in counter_res.items():\n",
    "    x.append(k)\n",
    "    y.append(v)\n",
    "\n",
    "plt.bar(x,y)\n",
    "plt.yscale('log')\n",
    "plt.xlabel('label value')\n",
    "plt.ylabel('label number')\n",
    "plt.title('label statistics')\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "477 13 490\n"
     ]
    }
   ],
   "source": [
    "print(counter_res[0], counter_res[1], counter_res[0] + counter_res[1])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py37",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
